// users.js
//账号是姓名，密码是身份证后六位
const users = [
{username:"admin",password:"zxinform",role:"admin"},
{username:"沈杰",password:"14243X",role:"student"},
{username:"雷健",password:"271457",role:"student"},
{username:"陈嘉乐",password:"284854",role:"admin"},
{username:"于天龙",password:"284013",role:"student"},
{username:"欧子畅",password:"224037",role:"student"},
{username:"李玮奇",password:"108736",role:"student"},
{username:"查俊杰",password:"104810",role:"student"},
{username:"邹志炜",password:"89712",role:"student"},
{username:"江昊冉",password:"173817",role:"student"},
{username:"雍清翔",password:"93017",role:"student"},
{username:"唐睿涵",password:"290019",role:"student"},
{username:"陆风和",password:"236319",role:"student"},
{username:"李鸿杰",password:"262039",role:"student"},
{username:"郁辰旷",password:"12503X",role:"student"},
{username:"周铭枫",password:"189715",role:"student"},
{username:"何天成",password:"42617",role:"student"},
{username:"贺鑫晨",password:"45811",role:"student"},
{username:"万君",password:"274030",role:"student"},
{username:"吕王宸",password:"242016",role:"student"},
{username:"章立成",password:"82511",role:"student"},
{username:"陈烨",password:"146736",role:"student"},
{username:"邓英杰",password:"71036",role:"student"},
{username:"李子圻",password:"31511X",role:"student"},
{username:"仇宗强",password:"22535",role:"student"},
{username:"胡奕翔",password:"166571",role:"student"},
{username:"钱威霖",password:"292012",role:"student"},
{username:"李承渝",password:"33533",role:"student"},
{username:"倪寅",password:"162010",role:"student"},
{username:"杨乾隆",password:"259719",role:"student"},
{username:"王禹熙",password:"61517",role:"student"},
{username:"许锦华",password:"114415",role:"student"},
{username:"李韦辰",password:"262013",role:"student"},
{username:"缪润哲",password:"02409X",role:"student"},
{username:"濮薪茹",password:"204026",role:"student"},
{username:"麻雨婷",password:"56640",role:"student"},
{username:"李欣怡",password:"310424",role:"student"},
{username:"黄心茹",password:"18202X",role:"student"},
{username:"贾睿曦",password:"223101",role:"student"},
{username:"朱元婷",password:"153066",role:"student"},
{username:"邹佳琪",password:"203022",role:"student"},
{username:"郁雪怡",password:"12061",role:"student"},

];


/**
 * 根据用户名获取完整用户对象
 * @param {string} username - 要查找的用户名
 * @return {object|null} - 返回用户对象，如果找不到则返回null
 */
function getUserByUsername(username) {
    return users.find(user => user.username === username) || null;
}

// 根据用户名获取密码的函数
function getPasswordByUsername(username) {
    const user = users.find(user => user.username === username);
    return user ? user.password : null;
}